#include <iostream>
#include <algorithm>
using namespace std;

template <typename T>
class Array
{
public:
    Array(T *array, int len)
    {
        this->array = array;
        this->size = len;
    }
    void My_sort();
    int My_find(T value);
    int My_count(T value);

    T &operator[](int index)
    {
        return array[index];
    }
private:
    T *array;
    int size;
};

template <typename T>
void Array<T>::My_sort()
{
    sort(array, array + size);
}

template <typename T>
int Array<T>::My_find(T value)
{
    return find(array, array + size, value) - array;
}

template <typename T>
int Array<T>::My_count(T value)
{
    return count(array, array + size, value);
}

int main()
{
    int a[5] = {5,4,5,21,3};
    Array<int> arr(a, 5);
    arr.My_sort();
    for (int i = 0; i < 5; i++)
    {
        cout << arr[i] << " ";
    }
    cout << endl;
    cout << arr.My_find(5) << endl;
    cout << arr.My_count(5) << endl;

    return 0;
}